home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-2.iso / Files II / Prog / T / ToolsPlus 2.1.sit / Tools Plus 2.1 ƒ / Tools Plus 2.1 (C & Pascal) / User Manual / 12-System Polling (4 of 4) < prev    next >
Encoding:
Text File  |  1993-10-24  |  11.5 KB  |  265 lines  |  [TEXT/ttxt]

  1. doClickControl (event)
  2. ``````````````````````
  3. Indicator that user clicked a custom control.
  4.  
  5. The doClickControl event reports that the user has clicked in a custom control.  This event must be handled entirely by your application, since only you know how your custom control should behave.
  6.  
  7. Programming Considerations
  8. ``````````````````````````
  9. • This event will never occur when the watch cursor is displayed, since
  10.   custom controls cannot be clicked.
  11.  
  12. Valid Polling Record Fields
  13. ```````````````````````````
  14. Poll.Window
  15. Poll.Event
  16. Poll.Modifiers
  17.  
  18. ------------------------------------------------------------------------
  19.  
  20. doManual (event)
  21.  
  22. Indicator that an event has been reported that can’t be processed by Tools Plus.
  23.  
  24. The doManualEvent event reports that some type of event has occurred which should be processed by your application.  This includes seven (7) possible types of events as defined by the Toolbox Event Manager, which are listed below.  If your application does not make use of any of these events, it can ignore the doManualEvent event code.
  25.  
  26.  
  27.    diskEvt     The Standard File Package takes care of all disk-inserted
  28.                events, so applications using this package can ignore
  29.                diskEvt events.  If your application is unusual and it
  30.                circumvents the Standard File package, your application
  31.                will have to handle disk-inserted events itself.
  32.  
  33.    networkEvt  Your application needs to respond to network events only
  34.                if it is going to be communicating with the AppleTalk
  35.                manager.  If it is, you should read the appropriate
  36.                documentation in chapter 10 Vol. 2 of Inside Macintosh
  37.                regarding network
  38.  
  39.    driverEvt   If your application does not intend to work with device
  40.                drivers, it can ignore these events.  Otherwise, you
  41.                should read the appropriate documentation in Inside
  42.                Macintosh regarding device drivers
  43.  
  44.    app1Evt     Application-defined events 1 through 4.  These are events
  45.    app2Evt     whose meaning is defined by your application.  If your
  46.    app3Evt     application does not define custom events, it can ignore
  47.    app4Evt     these event codes.  Note that app4Evt (or osEvt) will
  48.    osEvt       only be reported if your application does not respond to
  49.                Suspend/Resume events.  See the SIZE resource for
  50.                details.  If your application does respond to Suspend/
  51.                Resume events, it will receive a doSuspend or doResume
  52.                Tools Plus event.
  53.  
  54.    kHighLevel- Your application needs to respond to these events only if
  55.      Evt       you have defined the SIZE resource to respond to high-
  56.                level events.  See the SIZE resource for details.
  57.  
  58.  
  59. Valid Polling Record Fields
  60. ``````````
  61. Poll.Event
  62.  
  63. ------------------------------------------------------------------------
  64.  
  65. doMoveWindow (event)
  66. ````````````````````
  67. Indicator that user moved a window.
  68.  
  69. The doMoveWindow event reports that the user has repositioned a window by dragging it by its title bar.  Most applications will choose to ignore this event.
  70.  
  71. Programming Considerations
  72. ``````````````````````````
  73. • The dragged window might not be the active window.  The user can drag
  74.   an inactive window by holding down the Command key before beginning
  75.   the drag.
  76.  
  77. • If part or all of a window is exposed by the drag and needs to be
  78.   refreshed, a subsequent call to PollSystem will report a doRefresh
  79.   event for this window.
  80.  
  81. • Your application may call WindowStatus to obtain the window’s new
  82.   location in the screen’s global co-ordinates.
  83.  
  84. • This event will never occur when the watch cursor is displayed, since
  85.   the title bar cannot be clicked.
  86.  
  87. • A doMoveWindow event is not generated when the user drags a desk
  88.   accessory.  The process is handled automatically.
  89.  
  90. Valid Polling Record Fields
  91. ```````````````````````````
  92. Poll.Window
  93.  
  94. ------------------------------------------------------------------------
  95.  
  96. doGrowWindow (event)
  97. ````````````````````
  98. Indicator that user has changed a window’s size.
  99.  
  100. The doGrowWindow event reports that the user has changed a window by dragging a window’s “size box.”  This will always occur on the active window.
  101.  
  102. Programming Considerations
  103. ``````````````````````````
  104. • Your application can call the WindowStatus procedure to obtain the
  105.   window’s new width and height in pixels.
  106.  
  107. • If the window is enlarged either vertically or horizontally, a
  108.   subsequent call to PollSystem will report a doRefresh event for this
  109.   window.
  110.  
  111. • This event will never occur when the watch cursor is displayed, since
  112.   the size box cannot be clicked.
  113.  
  114. • A doGrowWindow event is not generated when the user changes a desk
  115.   accessory’s size.  The process is handled automatically.
  116.  
  117. Valid Polling Record Fields
  118. ```````````````````````````
  119. Poll.Window
  120.  
  121. ------------------------------------------------------------------------
  122.  
  123. doClickDesk (event)
  124. ```````````````````
  125. Indicator that user clicked in the desk top.
  126.  
  127. The doClickDesk event reports that the user has clicked in the desk top.  Most applications will choose to ignore this event, however, it can be used to deselect objects on the active window.
  128.  
  129. Programming Considerations
  130. ``````````````````````````
  131. • This event will never occur when a modal window is active, since
  132.   clicks cannot occur outside of the window.
  133.  
  134. • This event will never occur when the watch cursor is displayed, since
  135.   the desk top cannot be clicked.
  136.  
  137. Valid Polling Record Fields
  138. ```````````````````````````
  139. Poll.What
  140.  
  141. ------------------------------------------------------------------------
  142.  
  143. doZoomWindow (event)
  144. ````````````````````
  145. Indicator that user has changed a window’s size and/or location by zooming.
  146.  
  147. The doZoomWindow event reports that the user has changed a window’s size and/or position by clicking the “zoom box.”  This will always occur on the active window.  Applications will typically ignore this event, or treat it similarly to the doGrowWindow event.
  148.  
  149. Programming Considerations
  150. ``````````````````````````
  151. • Your application can call the WindowStatus procedure to obtain the
  152.   window’s new width and height in pixels, as well as its new location
  153.   in the screen’s global co-ordinates.
  154.  
  155. • The window’s entire contents are erased during the zoom.  A subsequent
  156.   call to PollSystem will report a doRefresh event for this window.
  157.   Responding to the doRefresh event will regenerate the window’s
  158.   contents.
  159.  
  160. • This event will never occur when the watch cursor is displayed, since
  161.   the zoom box cannot be clicked.
  162.  
  163. • A doZoomWindow event is not generated when the user click’s a desk
  164.   accessory’s zoom box.  The process is handled automatically.
  165.  
  166. ------------------------------------------------------------------------
  167.  
  168. doSuspend (event)
  169. `````````````````
  170. Indicator that your application is about to be suspended.
  171.  
  172. The doSuspend event reports that your application will be suspended (or become a “background” application) the next time you call PollSystem.  This occurs under MultiFinder or System 7 (or later) when a desk accessory or other application is launched, or when an inactive window belonging to a desk accessory or another application is activated.
  173.  
  174. DoSuspend and doResume events are not normally generated.  If your application requires these events, see the related documentation regarding the SIZE resource in the “Completing Your Application” chapter of this manual.
  175.  
  176. Programming Considerations
  177. ``````````````````````````
  178. • If your application is cutting, copying or pasting specialized objects
  179.   (i.e. not text that is handled by editing fields), copy this material
  180.   from your local scrap to the clipboard.
  181.  
  182. ------------------------------------------------------------------------
  183.  
  184. doResume (event)
  185. ````````````````
  186. Indicator that your application has been resumed.
  187.  
  188. The doResume event reports that your application has become the active application.  This occurs under MultiFinder or System 7 (or later) after your application has become suspended (see the doSuspend event).
  189.  
  190. DoSuspend and doResume events are not normally generated.  If your application requires these events, see the related documentation regarding the SIZE resource in the “Completing Your Application” chapter of this manual.
  191.  
  192. Programming Considerations
  193. ``````````````````````````
  194. • If your application is cutting, copying or pasting specialized objects
  195.   (i.e. not text that is handled by text editing fields), you may want
  196.   to check the clipboard to see if it contains the specialized objects
  197.   that you can paste, then copy them to your local scrap.
  198.  
  199. ------------------------------------------------------------------------
  200.  
  201. ResetMouseClicks
  202. ````````````````
  203. Discontinue a mouse’s “drag” or multiple clicks in progress.
  204.  
  205.    pascal void ResetMouseClicks(void);
  206.  
  207.  
  208.    procedure ResetMouseClicks;
  209.  
  210. The PollSystem function is used to detect single-clicks, double-clicks, and triple-clicks, as well as dragging which occurs between a mouse-down and mouse-up event.  In some applications, it may suffice to know that the user pressed the mouse button with the cursor being within a specific region or cursor zone, without concern for the mouse button’s release.  Or an application may allow a single-click only, thereby disallowing double or triple clicks.
  211.  
  212. In such cases, the ResetMouseClicks procedure can be used to tell Tools Plus that sufficient mouse information has been retrieved, and to reset the click and drag mechanism.  This reset will clear the current click or drag from PollSystem’s event queue.  The next time the mouse button in pressed down, it will be considered to be a first mouse-down of either a single-click, double-click, triple-click, or drag.
  213.  
  214. See PollSystem for details on how the system responds to mouse events.
  215.  
  216. ------------------------------------------------------------------------
  217.  
  218. ApplicationSuspended
  219. ````````````````````
  220. Determine if your application has been suspended (i.e. not the active application).
  221.  
  222.    pascal Boolean ApplicationSuspended(void);
  223.  
  224.    function ApplicationSuspended: BOOLEAN;
  225.  
  226. This function returns a value of true if a desk accessory or another application is active under MultiFinder or System 7 (or later).  A value of false will be returned if your application is active, even though your application may not have any windows open.
  227.  
  228. When running under MultiFinder or System 7 (or later), your application needs to have a SIZE resource with the “AcceptSuspendEvents” bit set to “1.”  See the SIZE resource for details.
  229.  
  230. ------------------------------------------------------------------------
  231.  
  232. “Field To Event” Cross reference
  233. ````````````````````````````````
  234. The following table provides a quick cross reference between each field in the polling record, and which events make use of that filed.
  235.  
  236. Poll.Button     doButton
  237.  
  238. Poll.Event      doClickControl, doManualEvent
  239.  
  240. Poll.Field      doClickField
  241.  
  242. Poll.Key…       doKeyDown, doAutoKey, doKeyUp
  243.  
  244. Poll.ListBox…   doListBox
  245.  
  246. Poll.Menu…      doMenu
  247.  
  248. Poll.Modifiers  doGoAway, doButton, doMenu, doKeyDown, doAutoKey,
  249.                 doKeyUp, doClickControl
  250.  
  251. Poll.Mouse…     doClick
  252.  
  253. Poll.ScrollBar… doScrollBar
  254.  
  255. Poll.What       doNothing, doChgWindow, doRefresh, doGoAway, doButton,
  256.                 doMenu, doKeyDown, doAutoKey, doKeyUp, doClickField,
  257.                 doScrollBar, doListBox, doClick, doClickControl,
  258.                 doManualEvent, doMoveWindow, doGrowWindow, doClickDesk,
  259.                 doZoomWindow, doSuspend, doResume
  260.  
  261. Poll.Window     doChgWindow, doRefresh, doGoAway, doButton, doKeyDown,
  262.                 doAutoKey, doKeyUp, doClickField, doScrollBar,
  263.                 doListBox, doClick, doClickControl, doMoveWindow,
  264.                 doGrowWindow, doZoomWindow
  265.